package com.mpyy.pojo;

import lombok.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
* customer_info 实体类
* Wed Feb 23 09:47:17 CST 2022 tangneng
*/ 
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CustomerInfo{

	private String custId;

	private String custName;

	private String custPhone;

	private String custAddress;

	private String custTypeId;

	private String custSex;

	private Date custDate;

	private String custMenmber;

	private String custComment;

	private String null1;

	//庞俏分页参数
	private Integer page;

	private Integer limit;

	public void setPage(Integer page){
		this.page = ( page - 1 ) * this.limit;
	}
	///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑


	
	//因为数据从页面传过来不能识别data，问题暂时没有得到解决所以用String类型代替
//	private String custDate;
	//连接客户类型表
	private CustomerType customerType;


	public void setCustDate(String custDate){
		if ( null != custDate && !"".equals(custDate)) {
			try {
				SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
				this.custDate = simpleDateFormat.parse(custDate);

			} catch (ParseException e) {
				e.printStackTrace();
			}
		}
	}

}

